// ts封装接口
interface Person {
	name: string
	age?: number
	readonly isMale: boolean
	say: (words: string) => string
	[propName: string]: any
}

interface Father {
	color: string
}

interface Mather {
	height: number
}

interface Son extends Father, Mather {
	name: string
	age: number
}

// 调用 (user:'定义的类型’):返回的数据类型
const getUserInfo = (user: Son):string => {
  return `name: ${user.name}`
}

getUserInfo({
  name:'wangkun',
  age: 18,
  color: 'orange',
  height: 188
})


// ts修饰符
public: 可以自由访问类中定义的内容
private: 只能在类的内部进行访问
protect: 除了可以再该类的内部访问，还可以在子类中访问

class Father {
  protected name: string;
  constructor(name:string){
    this.name = name
  }
}
